package LotterDrawing;

import java.sql.Array;
import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * Created by jyo on 15-8-29.
 */
public class LotteryDrawing {
    public static void  main(String[] args){
        Scanner in  =   new Scanner(System.in);

        System.out.println("How many number do you need to draw?");
        int k = in.nextInt();

        System.out.println("What is highest number you can draw?");
        int n = in.nextInt();

        int[] numbers=new int[n];
        int ra;
        for (int i=0;i<numbers.length;i++)
            numbers[i]=i+1;

        int[] result =new int[k];
        for (int i=0;i<result.length;i++){
//          内部变量随机值乘以n的倍数
            int rm;
            rm =(int)(Math.random());
             ra  = (int)(Math.random()*n);
//            System.out.println("r:"+r);
            result[i]=numbers[ra];
//            numbers[ra]=numbers[n-1];
            n--;
        }
        Arrays.sort(result);
        System.out.println("Bet the following combination.It'll make you rich!");
        for (int r:result)
            System.out.println(r);
    }
}
